Skip to main content

Zenith Customer Contract

Introduction

This will import zenith vehicles in to ViSN, and allocate vehicles to sub customers for zenith

download sample zenith customer contract import file.

File format

Comma Separated Values - *.csv
Encoding - UTF-8

Zenith Customer Customers Import

Zenith Customer contract fieldsDescriptionMax lengthData TypeRulesMandatoryDefault ValuesExample
RegistrationVehicle Registration number10StringA-Z & 0-9 CharactersY200LTW
VINVehicle identification number20StringA-Z 0-9 and Special CharactersNSALCA2AN9MH890904
Asset NumberAsset Number50StringA-Z & 0-9, space and hyphen (-)N88 AX29-UE39
Registration DateRegistration DateNANumberDDMMYYYYN30102024
MakeMake of the vehicle50StringA-Z 0-9 and Special CharactersNFord
ModelModel of the vehicle50StringA-Z 0-9 and Special CharactersNEscape
SpecificationSpecification100StringA-Z 0-9 and Special CharactersNManual transmission
Fuel TypeFuel type of vehicle50StringA-Z 0-9 and Special CharactersNPetrol
Vehicle TypeType of vehicleNAStringNAYValid vehicle types:
Car, LCV, Van, Commercial (under 3.5), Commercial (over 3.5), HGV, Motor Bike, Electric Car
Contract Start Date Start date of contractNANumberDDMMYYYYN30102024
Contract End DateEnd date of contractNANumberDDMMYYYYN30102024
Contract Mileage TermMileage of Vehicle6Number0-9N33448
CAPIDCap Id20StringA-Z 0-9 and Special CharactersNQW82JK764HSN
Argic CodeArgic Code20StringA-Z 0-9 and Special CharactersN82JK764HSN
ColourColour of Vehicle200StringA-Z 0-9 and Special CharactersNPearl White
MOT Due dateLast date for MOTNANumberDDMMYYYYN30102024
MaintainedOnly "Maintained" vehicles are imported, if the value is other than Y, then it is ignored and a log is added
NAStringY or NNY
Service ScheduleService Schedule8Number0-9N23821828
Warranty Parameter MonthsWarranty parameter months3Number0-9N24
Warranty Parameter MileageWarranty mileage6Number0-9N223445
FridgeFridgeNAStringY or NNNN
Tail LiftTail LiftNAStringY or NNNN
CraneCraneNAStringY or NNNN
Customer Account NumberCustomer Account Number50StringA-Z 0-9 and Special CharactersNXW442TYW
SMRSMRNAStringY or NNNN
TyresTyresNAStringY or NNNN
GlassGlassNAStringY or NNNN
Accident ManagementAccident ManagementNAStringY or NNNN
BreakdownBreakdownNAStringY or NNNN
InsuranceInsuranceNAStringY or NNNN
RentalRentalNAStringY or NNNN
Driver FirstnameDriver first name50StringA-Z 0-9 and Special CharactersNAndré
Driver LastnameDriver Last name50StringA-Z 0-9 and Special CharactersNFrédéric
Driver EmailDriver Email50StringStandard email formatNdriver@email.com
Driver NumberDriver Number11Number0-9N23821828
Policy NumberPolicy Number25StringA-Z & 0-9 Space, Dash and hyphenN931-292
Policy Start DatePolicy Start DateNANumberDDMMYYYYN30102024
Policy End DatePolicy End DateNANumberDDMMYYYYN30102024
Policy TermPolicy Term100StringA-Z 0-9 and Special CharactersNThe policy term is valid from 01/01/2024 to 12/31/2024
Product TypeProduct Type20Stringa-z A-Z 0-9NWR91OJ

Importing a file

Preparation

  1. Create a new branch with Jira task number in the branch name

  2. Delete all the files in importFiles folder

  3. Create a folder with the current sprint number

  4. Copy the file that needs to be imported

  5. Go to package.json , find the line validate:zenithCustomerContract

  6. Modify --leaseId with the required lease Id

  7. Modify --file with the relative path of the file

  8. Save package.json

Validating locally

  1. in a terminal run npm run build

  2. in a terminal run npm run validate:zenithCustomerContract

  3. If there are no errors, push the code

Validating in workflow

  1. Go to Action of Import-manger

  2. Find <Environment> - on-demand-import

  3. Select the branch that was created for this import

  4. Enter script name as validate:zenithCustomerContract

  5. Leave Overrides empty

Importing the file

  1. If the validation has passed

  2. Go to Action of Import-manger

  3. Find <Environment> - on-demand-import

  4. Select the branch that was created for this import

  5. Enter script name as import:zenithCustomerContract

  6. Enter --persist in Overrides field

Importing the file via cloud run

Creating Schedulers for validating the zenith customer contract

  1. Go to Cloud Scheduler and select the CREATE JOB

Setup Required

A Scheduler should be created cloud scheduler with the following parameters

  • Name: zenith_customer_contract_import_without_sub_customers_file_validation
  • Region: europe-west2
  • Frequency: 0 0 31 12 1
  • TimeZone: GMT London
  • Target type: HTTP
  • URL: URL : https://import-manager-36r2bu4izq-uc.a.run.app/zenith-customer-contract
  • HTTP method: POST
  • Auth header: select OIDC token
  • Service account: cloud-run-import-customer-contract
  • body: a JSON object including the following parameters

JSON object for zenith_customer_contract_import_file_validation scheduler

{
"leaseId": "QJKgdjS4I02sEia4yTne",
"leaseCompanyName": "Next Fleet Services",
"persist": "false",
"bucket": "biddirect-2.appspot.com",
"appDirectory": "/usr/src/app/",
"importPath": "imports/fileDrop/",
"importFileDropPath": "imports/fileDrop/",
"importFileName": "zenithCustomerContracts.csv",
"email": "mailgun@digitalinnk.com",
"fatalErrorEmailToAddress": "mailgun@digitalinnk.com",
"schema": "ZENITH_CUSTOMER_CONTRACT"
}

Create scheduler for validating Zenith customer contract

Creating Schedulers for importing the zenith customer contract

  1. Go to Cloud Scheduler and select the CREATE JOB

Setup Required

A Scheduler should be created cloud scheduler with the following parameters

  • Name: zenith_customer_contract_file_import_without_sub_customers
  • Region: europe-west2
  • Frequency: 0 0 31 12 1
  • TimeZone: GMT London
  • Target type: HTTP
  • URL: https://import-manager-36r2bu4izq-uc.a.run.app/zenith-customer-contract
  • HTTP method: POST
  • Auth header: select OIDC token
  • Service account: cloud-run-import-customer-contract
  • body: a JSON object including the following parameters

JSON object for zenith_sub_customer_file_import scheduler

{
"leaseId": "QJKgdjS4I02sEia4yTne",
"leaseCompanyName": "Next Fleet Services",
"persist": "true",
"bucket": "biddirect-2.appspot.com",
"appDirectory": "/usr/src/app/",
"importPath": "imports/fileDrop/",
"importFileDropPath": "imports/fileDrop/",
"importFileName": "zenithCustomerContracts.csv",
"email": "mailgun@digitalinnk.com",
"fatalErrorEmailToAddress": "mailgun@digitalinnk.com",
"schema": "ZENITH_CUSTOMER_CONTRACT"
}

Create scheduler for importing Zenith customer contract

Preparation:

  1. Bucket name is biddirect-2.appspot.com and it will vary for higher envs and the file path should imports/fileDrop, where you can drop the CSV file named "zenithCustomerContract". This action will place the file in the specified location within the designated bucket.

Validation:

  1. Go to Cloud Scheduler
  2. Run zenith_customer_contract_import_file_validation job (job name could be different on other env)
logs in cloud

Importing:

  1. Go to Cloud Scheduler
  2. Run zenith_customer_contract_file_import job (job name could be different on other env)
logs in cloud

Testing

  1. Zenith vehicles will be imported and allocated to sub customers, You can verify this by navigating to the ViSN customer platform and selecting Vehicle Record search for imported vehicle.
Status: Pending Approval
Category: Protected
Authored By: Sohan on November 8, 2024